﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListNews.ascx.cs" Inherits="GUI.Controls.News.ListNews" %>
<ul class="list clearfix">
    <asp:Literal ID="ltrData" runat="server"></asp:Literal>
</ul>
<script type="text/javascript">
    onLoad(function () {
        var scope = $('.scope');
        if (scope && scope.length > 0) {
            scope.each(function () {
                var title = $(this).find('.prop_title');
                var catUrl = (title.attr('href')).split('/')[1];
                var theme = getThemeByCatUrl(catUrl);
                $(this).find('.prop_thread a').addClass("cl-" + theme);
            });
        }

        function getThemeByCatUrl(catUrl) {
            switch (catUrl) {
                case 'xa-hoi':
                case 'the-gioi':
                case 'quan-su':
                case 'kinh-doanh':
                    {
                        return "blue";
                    }
                case 'phap-luat':
                    {
                        return "brown";
                    }
                case 'cong-nghe':
                case 'the-thao':
                    {
                        return "green";
                    }
                case 'giai-tri':
                case 'suc-khoe':
                case 'dep':
                    {
                        return "pink";
                    }
                case 'chuyen-la':
                case 'cu-dan-mang':
                    {
                        return "orange";
                    }
                default:
                    return '';
            }
        }
    }, "News.ListNews.aspx");
</script>
